﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace B.S.RbacData.Infrastructure.Migrations
{
    public partial class 屠宰信息和屠宰企业信息 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "AddressAreas",
                columns: table => new
                {
                    AreaId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ParentId = table.Column<int>(type: "int", nullable: false),
                    Level = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AddressAreas", x => x.AreaId);
                });

            migrationBuilder.CreateTable(
                name: "SlaughterCorporates",
                columns: table => new
                {
                    SlaughterCorporateId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CompanyName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CompanyAddressId = table.Column<int>(type: "int", nullable: false),
                    CompanyArrdess = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    EstablishmentTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CompanyProfile = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Creatime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ProductId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SlaughterCorporates", x => x.SlaughterCorporateId);
                });

            migrationBuilder.CreateTable(
                name: "Slaughters",
                columns: table => new
                {
                    SlaughterId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ArrivalAverageWeight = table.Column<int>(type: "int", nullable: false),
                    ArrivalTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SlaughterTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ProductId = table.Column<int>(type: "int", nullable: false),
                    Creatime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Slaughters", x => x.SlaughterId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "AddressAreas");

            migrationBuilder.DropTable(
                name: "SlaughterCorporates");

            migrationBuilder.DropTable(
                name: "Slaughters");
        }
    }
}